package com.linkme2night.model;

import java.io.File;
import java.io.InputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;

public class XmlCon {

	private static Document doc;

	public void main(String argv[]) {
		LoadFile();
	}
	
	//Loads the xml file
	public void LoadFile() {
		try {
			DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
					.newInstance();
			DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
			String file = "res/raw/lm2n.xml";
			InputStream in = this.getClass().getClassLoader().getResourceAsStream(file);
			doc = docBuilder.parse(in);

			// normalize text representation
			doc.getDocumentElement().normalize();
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
	
	//Returns the document for parsing
	public Document getDoc() {
		return doc;
	}
}